#include "pyobjsize.h"
pyobjsize::pyobjsize() {
	if (Py_IsInitialized() == 0) {
		Py_Initialize();
	};
};
unsigned long long pyobjsize::sizeget(PyObject* sou) {
	PyGILState_STATE gstate = PyGILState_Ensure();
	PyObject* sysmodule = PyImport_ImportModule("sys");
	sysfunc = PyObject_GetAttrString(sysmodule, "getsizeof");
	PyObject* pResult = PyObject_CallFunctionObjArgs(sysfunc, sou);
	long long res = PyLong_AsLongLong(pResult);
	PyGILState_Release(gstate);
	res *= 1024 * 1024;
	return res;

}